<?php

class Article extends Controller {

    function __construct() {
        parent::__construct();
        $this->loadModel('article');
        //echo 'We are inside article controller<br />';
    }

    public function index(){
        if (Session::get('loggedIn')){
            $data = $this->model->getData();
            $this->view->assign('msg', $data['msg']);
            $this->view->assign('list', $data['list']);

            $this->view->render('article/index');

        }else{
            header('Location: ./index.php');
        }

    }


    public function getRunTimeJessiMsg(){


        /* gut beispiel für fancy box

         * $content ="<script type='text/javascript'>

        $(document).ready(function() {

    $.fancybox([
        'http://farm5.static.flickr.com/4044/4286199901_33844563eb.jpg',
        'http://farm3.static.flickr.com/2687/4220681515_cc4f42d6b9.jpg',
        {
            'href'	: 'http://farm5.static.flickr.com/4005/4213562882_851e92f326.jpg',
            'title'	: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'
        }
    ], {
            'padding'			: 0,
        'transitionIn'		: 'none',
        'transitionOut'		: 'none',
        'type'              : 'image',
        'changeFade'        : 0
    });

});

       </script> ";*/
        /*$content .='<div class="scroll">
    <div class="pics">';

        $content .= '<div class="sliderItem" ><img src="'.URL.'public/media/images/ol_1.jpg" alt="" /></div>';
        $content .= '<div class="sliderItem" ><img src="'.URL.'public/media/images/ol_2.jpg" alt="" /></div>';
        $content .= '<div class="sliderItem" ><img src="'.URL.'public/media/images/ol_4.jpg" alt="" /></div>';
        $content .='</div></div>';*/
        $content =  "<h2>没有你我怎么办 ？？？？？ 尤其是当我面对这些无法抹去的充满爱的温存回忆。。。</h2>";
        //$content =  "<h2>Ich hätte so gerne,dass immer krank bin ...</h2>";
        $content .='﻿<div class="box full">
                        <div style="margin:0 auto; width: 634px; height:120px;">
                            <!-- "previous page" action -->
                            <!--a class="prev browse left"></a-->

                            <!-- root element for scrollable -->
                            <div id="autoscroll" class="scrollable">
                                <!-- root element for the items -->
                                <div class="items" style="left: -2040px;">
                                    <!-- 1-5 -->
                                    <div>
                                       <img src="'.URL.'public/media/images/57_1.jpg" alt="" />

                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_2.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_3.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_4.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_5.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_6.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_7.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_8.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/57_9.jpg" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_1.JPG" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_2.JPG" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_3.JPG" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_4.JPG" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_5.JPG" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_6.JPG" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_7.JPG" alt="" />
                                    </div>
                                    <div>
                                        <img src="'.URL.'public/media/images/519_8.JPG" alt="" />
                                    </div>
                                </div>

                            </div>
                        </div>
                        <br clear="all">
                    </div>';
        $size = Helper::getJessiVideoSize();
        $content .= '<div class="cacsTxt" style="padding-top: 20px;text-align: center;">';
        //$content .= '<iframe width="'.$size['w'].'" height="'.$size['h'].'" src="http://www.youtube.com/embed/nimSGwmC3BU?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>';
        $content .= '<iframe width="'.$size['w'].'" height="'.$size['h'].'" src="http://www.youtube.com/embed/nfc5gx4fRfg?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>';
        $content .= '</div>';
        return $content;
    }

    public function getRunTimeJessiFooterMsg(){

        return '';
        $size = Helper::getJessiVideoSize();
        return '<iframe width="'.$size['w'].'" height="'.$size['h'].'" src="http://www.youtube.com/embed/nimSGwmC3BU?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>';
    }


    public function other($arg = false) {
        //echo 'we are inside other<br />';
        //echo 'Optional: ' . $arg . '<br />';

        require 'models/article.php';
        $model = new Model_Article();
    }

}